import axios from 'axios'
import qs from 'qs'

export async function getAllGoodsOrders (shopId, pageNo, pageSize) {
  let resp = await axios.get('api/goods_order', {
    params: {
      shopId, pageNo, pageSize
    }
  })
  console.log('所有订单:')
  console.log(resp)
  return resp
}

export async function getGoodsOrderInfo (shopId, orderId) {
  let resp = await axios.get('api/goods_order', {
    params: {
      shopId, orderId
    }
  })
  console.log('订单详情:')
  console.log(resp)
  return qs.stringify(resp)
}

export async function updateGoodsOrder (Order) {
  let resp = await axios.post('', qs.stringify({
    method: 'updateGoodsOrder',
    orderStatus: Order.status
  }))
  console.log(resp.data)
  return resp.data
}
